package com.ming.springboot.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * Created by mqsi on 2022/5/15 19:53
 */
public class JsonUtil {
	private static final ObjectMapper MAPPER = new ObjectMapper();

	public static String objectToJson(Object data){
		try {
			return MAPPER.writeValueAsString(data);
		} catch (JsonProcessingException e) {
			e.printStackTrace();
		}
		return null;
	}


}
